Advanced button library

Every Salesforce org is unique, and sometimes you need to create enhanced functionality for your Sertifi app. The following scenarios are a great way to get you started with some of the most common advanced button requests. For additional code samples, see Sertifi's Bitbucket repository. You can use these code samples to build even further functionality than what's discussed in this article. For any questions, or advice on further customization, contact your Sertifi Customer Success Manager.

This article contains the following sections:

Prerequisites

To incorporate these buttons, complete the Creating a custom Sertifi button workflow until step 6, and then update the text for the button with the appropriate syntax for each scenario. You can find the syntax for each button scenario in this article.

Ensure that you update the object name (in these examples Opportunity) with the Salesforce object you're adding the custom button to.

Adding additional attachments based on a picklist value

You can add additional attachments based on a picklist value from the Opportunity object. To attach extra documents, you need the ObjectID to populate into Sertifi's parameters. You can add these additional attachments as an "if, then" statement in your custom button.

In this scenario, use the default Stage value on the Opportunity object, and check to see if the Stage name equals Qualification. If the Stage name equals Qualification, then you want to send an additional document for signature.

To add an additional document when the Stage name equals Qualification:

  1. Ensure you have the correct Salesforce Formula fields: IF, ISPICKVAL, and URLFOR.
  2. Ensure you have the correct Sertifi URL parameters: &oppID= and &attachmentID=
  3. Start with your base function: {!IF(logical_test, value_if_true, value_if_false)}
  4. Add the function for looking at picklist values: {!IF(ISPICKVAL(picklist_field, text_literal), value_if_true, value_if_false)}
  5. Fill in the parameters for the picklist value: {!IF(ISPICKVAL(Opportunity.StageName , "Qualification"), value_if_true, value_if_false)}
  6. Point to true to include the attachmentID in the URL parameter: {!IF(ISPICKVAL(Opportunity.StageName , "Qualification"), URLFOR(target, id, [inputs], [no override]), value_if_false)}
  7. Remove any unnecessary parameters: {!IF(ISPICKVAL(Opportunity.StageName , "Qualification"), URLFOR(target), value_if_false)}
  8. Fill in the values specific to your org: {!IF(ISPICKVAL(Opportunity.StageName , "Qualification"), URLFOR("/apex/Sertifi2_0__CreateSignatureRequest?oppID=" & Opportunity.Id & "&attachmentID=0151U000000K3JcQAK"), value_if_false)}
  9. Replace the value if false: {!IF(ISPICKVAL(Opportunity.StageName , "Qualification"), URLFOR("/apex/Sertifi2_0__CreateSignatureRequest?oppID=" & Opportunity.Id & "&attachmentID=0151U000000K3JcQAK"), URLFOR("/apex/Sertifi2_0__CreateSignatureRequest?oppID=" & Opportunity.Id))}

The resulting code adds an additional document for signature if the Stage name equals Qualification.

Automatically selecting a checkbox on the Sertifi EContract record

You can enable a button to include certain signers as CCs if a checkbox was marked for auditing purposes. In order to create this functionality, you must first ensure that:

  • You created a new custom setting to send from the Accounts object.
  • You changed LinkObjectType in the Sertifi ESign Custom Settings from the default Opportunity to Account.

If you completed the aforementioned prerequisites, then you can move forward in adding the checkbox functionality. To enable an automatic selection of a checkbox:

  1. Ensure you completed the prerequisites.
  2. Ensure you have the correct Salesforce Formula fields: IF, URLFOR.
  3. Ensure you have the correct Sertifi URL parameters: &actID=, &customsettings=, and &CCsigner=
  4. Add the base function to accomplish the task: {!IF(logical_test, value_if_true, value_if_false)}
  5. Add a field to check True/False: {!IF(Account.Audit_Trail__c, value_if_true, value_if_false)}
  6. Add the URLFOR function to point to the Sertifi sending wizard: {!IF(Account.Audit_Trail__c, URLFOR(target, id, [inputs], [no override]), value_if_false)}
  7. Remove any unnecessary parameters: {!IF(Account.Audit_Trail__c, URLFOR(target), value_if_false)}
  8. Insert the Sertifi parameters into the URL target: {!IF(Account.Audit_Trail__c, URLFOR("/apex/Sertifi2_0__CreateSignatureRequest?actID=" & Account.Id & "&[email protected]&customsettings=Account"), value_if_false)}
  9. Insert the remaining Sertifi URL parameters to remove the &CCsigner= parameter from the request when the value is false: {!IF(Account.Audit_Trail__c, URLFOR("/apex/Sertifi2_0__CreateSignatureRequest?actID=" & Account.Id & "&[email protected]&customsettings=Account"), URLFOR("/apex/Sertifi2_0__CreateSignatureRequest?actID=" & Account.Id & "&customsettings=Account"))}

The resulting code automatically includes certain signers as CCs when a checkbox is selected.

Automatically adding payments to a signature request based on a value

You can automatically add a payment to a signature request if a value is greater than or equal to a certain numerical value. In order to create this functionality, you must first ensure that:

  • You change the Custom Settings for the Sertifi ESign package from Opportunity to your custom object.

To automatically add a payment to a signature request:

  1. Ensure you complete the aforementioned prerequisite.
  2. Ensure you have the correct Salesforce Formula fields: IF, URLFOR, <=, TODAY, TEXT
  3. Ensure you have the correct Sertifi URL parameters: &objectID, &customsettings=, &paymentname=, &paymentamount=, and &paymentDueDate=
  4. Add the base function to create the task: {!IF(logical_test, value_if_true, value_if_false)}
  5. Check to see if the value is greater than or equal to the value you specify. In this example $1.75: {!IF(Energy_Audit__c.Average_Annual_Electric_Cost__c >= 1.75, value_if_true, value_if_false)}
  6. Add the URLFOR function to point to the Sertifi sending wizard: {!IF(Energy_Audit__c.Average_Annual_Electric_Cost__c >= 1.75, URLFOR(target, id, [inputs], [no override]), value_if_false)}
  7. Remove any unnecessary parameters: {!IF(Energy_Audit__c.Average_Annual_Electric_Cost__c >= 1.75, URLFOR(target), value_if_false)}
  8. Add the Sertifi parameters if the statement is true: {!IF(Energy_Audit__c.Average_Annual_Electric_Cost__c >= 1.75, URLFOR("/apex/Sertifi2_0__CreateSignatureRequest?objectID=" & Energy_Audit__c.Id & "&customsettings=EnergyAudit&paymentname=sample payment&paymentamount=" & TEXT( Energy_Audit__c.Average_Annual_Electric_Cost__c) & "&paymentDueDate=" & TEXT( TODAY() + 5)), value_if_false)}
  9. Add the Sertifi parameters if the statement is false: {!IF(Energy_Audit__c.Average_Annual_Electric_Cost__c >= 1.75, URLFOR("/apex/Sertifi2_0__CreateSignatureRequest?objectID=" & Energy_Audit__c.Id & "&customsettings=EnergyAudit&paymentname=sample payment&paymentamount=" & TEXT( Energy_Audit__c.Average_Annual_Electric_Cost__c) & "&paymentDueDate=" & TEXT( TODAY() + 5)), URLFOR("/apex/Sertifi2_0__CreateSignatureRequest?objectID=" & Energy_Audit__c.Id & "&customsettings=EnergyAudit"))}

The resulting code automatically includes a payment to the signature request based on a value you specify.